import Book.BookList;
import User.AdminUser;
import User.NormalUser;
import User.User;

import java.util.Scanner;

public class Main {
    public static User login() {
        System.out.println("请输入您的名字");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入选择身份1管理员，0普通成员");
        int choice = scanner.nextInt();
        if(choice==1){
            return new AdminUser(name);
        }else{
            return new NormalUser(name);
        }
    }
    public static void main(String[] args) {
        BookList bookList = new BookList();
        User user =login();
        while (true){
            int choice = user.menu();
            user.doOperatoin(choice, bookList);
        }
    }
}
